<!--
 * @LastEditTime : 2022-10-26 16:00:32
 * @FilePath     : /pyy/src/components/SvgIcon/index.vue
 * @Description  : 公共组件 > svg
-->
<template>
  <svg class="svg-icon" aria-hidden="true" v-bind="$attrs" v-on="$listeners">
    <use :xlink:href="iconName" />
  </svg>
</template>

<script>
export default {
  name: "SvgIcon",
  props: {
    // svg name
    name: {
      type: String,
      required: true,
    },
  },
  computed: {
    iconName() {
      return `#icon-${this.name}`;
    },
  },
};
</script>

<style scoped>
.svg-icon {
  width: 20px;
  height: 20px;
  /*fill: currentColor;*/
  /*overflow: hidden;*/
}
</style>
